# 需要放到新建项目中
import socket

client = socket.socket()

client.connect(('127.0.0.1', 8882))

info=''

while info != 'quit':
    send_data = input('请输入你要发送的数据')

    client.send(send_data.encode('utf-8'))

    if send_data == 'quit':
        break

    info = client.recv(1024).decode('utf-8')
    print('从服务器中接受到的数据', info)

client.close()